<template>
    <div>
        <echartsList
            :x_data="x_data"
            ref="myEcharts"
            :seriesList="seriesList"
            :name="name"
        ></echartsList>
        <div class="tableTab tab_box_fiance">
            <span
                class="tableBtn"
                :class="{ on: index == timeIdx }"
                @click="onTime(item, key, index)"
                v-for="(item, key, index) in timeType"
                :key="index"
                v-show="isQuarter != key"
                >{{ item }}</span
            >
        </div>

        <!-- 现金流量表  非银行金融 -->
        <div class="table w1021 flex" v-if="isBank == 'nonbank'">
            <div class="tableTh tableTr flex wrap w220 nonbank_w220 right">
                <span class="tableTd left_tableTd">现金流量表(百万元)</span>
                <span
                    :class="{
                        active_Row: activeRow == key,
                        high: item.high,
                    }"
                    @click="handSelect(key, item.itemInfo)"
                    v-for="(item, key, index) in nonbankData"
                    class="tableTd top left_tableTd"
                >
                    {{ item.title }}
                </span>
            </div>
            <div class="tableTr tableBody flex">
                <div
                    class="flex wrap w130"
                    v-for="(item, index) in datalist"
                    :key="index"
                >
                    <span class="tableTd">{{ item.rptDate | dateFrom }}</span>
                    <span
                        :class="{ active_Row: activeRow == 1 }"
                        @click="handSelect(1, 'fc110033')"
                        class="orange tableTd top"
                        >{{ item.fc110033 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 2 }"
                        @click="handSelect(2, 'fc110035')"
                        class="orange tableTd top"
                        >{{ item.fc110035 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 3 }"
                        @click="handSelect(3, 'fc110037')"
                        class="orange tableTd top"
                        >{{ item.fc110037 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 4 }"
                        @click="handSelect(4, 'fc110000')"
                        class="orange tableTd top"
                        >{{ item.fc110000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 5 }"
                        @click="handSelect(5, 'fc120033')"
                        class="orange tableTd top"
                        >{{ item.fc120033 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 6 }"
                        @click="handSelect(6, 'fc120035')"
                        class="orange tableTd top"
                        >{{ item.fc120035 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 7 }"
                        @click="handSelect(7, 'fc120000')"
                        class="orange tableTd top"
                        >{{ item.fc120000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 8 }"
                        @click="handSelect(8, 'fc100000')"
                        class="orange tableTd top"
                        >{{ item.fc100000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 9 }"
                        @click="handSelect(9, 'fc120032')"
                        class="orange tableTd top"
                        >{{ item.fc120032 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 10 }"
                        @click="handSelect(10, 'fc120037')"
                        class="orange tableTd top"
                        >{{ item.fc120037 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 11 }"
                        @click="handSelect(11, 'fc210001')"
                        class="orange tableTd top"
                        >{{ item.fc210001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 12 }"
                        @click="handSelect(12, 'fc210007')"
                        class="orange tableTd top"
                        >{{ item.fc210007 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 13 }"
                        @click="handSelect(13, 'fc210008')"
                        class="orange tableTd top high"
                        >{{ item.fc210008 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 14 }"
                        @click="handSelect(14, 'fc210009')"
                        class="orange tableTd top"
                        >{{ item.fc210009 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 15 }"
                        @click="handSelect(15, 'fc210010')"
                        class="orange tableTd top"
                        >{{ item.fc210010 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 16 }"
                        @click="handSelect(16, 'fc210000')"
                        class="orange tableTd top"
                        >{{ item.fc210000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 17 }"
                        @click="handSelect(17, 'fc220001')"
                        class="orange tableTd top"
                        >{{ item.fc220001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 18 }"
                        @click="handSelect(18, 'fc220003')"
                        class="orange tableTd top high"
                        >{{ item.fc220003 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 19 }"
                        @click="handSelect(19, 'fc220004')"
                        class="orange tableTd top"
                        >{{ item.fc220004 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 20 }"
                        @click="handSelect(20, 'fc220008')"
                        class="orange tableTd top"
                        >{{ item.fc220008 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 21 }"
                        @click="handSelect(21, 'fc220000')"
                        class="orange tableTd top"
                        >{{ item.fc220000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 22 }"
                        @click="handSelect(22, 'fc200000')"
                        class="orange tableTd top"
                        >{{ item.fc200000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 23 }"
                        @click="handSelect(23, 'fc310003')"
                        class="orange tableTd top"
                        >{{ item.fc310003 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 24 }"
                        @click="handSelect(24, 'fc310005')"
                        class="orange tableTd top"
                        >{{ item.fc310005 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 25 }"
                        @click="handSelect(25, 'fc310006')"
                        class="orange tableTd top"
                        >{{ item.fc310006 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 26 }"
                        @click="handSelect(26, 'fc310000')"
                        class="orange tableTd top"
                        >{{ item.fc310000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 27 }"
                        @click="handSelect(27, 'fc320001')"
                        class="orange tableTd top"
                        >{{ item.fc320001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 28 }"
                        @click="handSelect(28, 'fc320004')"
                        class="orange tableTd top"
                        >{{ item.fc320004 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 29 }"
                        @click="handSelect(29, 'fc320009')"
                        class="orange tableTd top"
                        >{{ item.fc320009 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 30 }"
                        @click="handSelect(30, 'fc320000')"
                        class="orange tableTd top"
                        >{{ item.fc320000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 31 }"
                        @click="handSelect(31, 'fc300000')"
                        class="orange tableTd top"
                        >{{ item.fc300000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 32 }"
                        @click="handSelect(32, 'fc000004')"
                        class="orange tableTd top"
                        >{{ item.fc000004 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 33 }"
                        @click="handSelect(33, 'fc800000')"
                        class="orange tableTd top"
                        >{{ item.fc800000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 34 }"
                        @click="handSelect(34, 'fc500001')"
                        class="orange tableTd top"
                        >{{ item.fc500001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 35 }"
                        @click="handSelect(35, 'fc000006')"
                        class="orange tableTd top"
                        >{{ item.fc000006 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 36 }"
                        @click="handSelect(36, 'fc310007')"
                        class="orange tableTd top"
                        >{{ item.fc310007 | filterVal("number") }}</span
                    >
                </div>
            </div>
        </div>
        <!-- 现金流量表  非银行金融 -->

        <!-- 现金流量表  非金融 -->
        <div class="table w1021 flex" v-if="isBank == 'gen'">
            <div class="tableTh tableTr flex wrap w220 right">
                <span class="tableTd">现金流量表(百万元)</span>
                <span
                    :class="{
                        active_Row: activeRow == key,
                        high: item.high,
                    }"
                    @click="handSelect(key, item.itemInfo)"
                    v-for="(item, key, index) in genData"
                    class="tableTd top left_tableTd"
                >
                    {{ item.title }}
                </span>
            </div>
            <div class="tableTr tableBody flex">
                <div
                    class="flex wrap w130"
                    v-for="(item, index) in datalist"
                    :key="index"
                >
                    <span class="tableTd">{{ item.enddate | dateFrom }}</span>
                    <span
                        :class="{ active_Row: activeRow == 1 }"
                        @click="handSelect(1, 'c110101')"
                        class="orange tableTd top high"
                        >{{ item.c110101 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 2 }"
                        @click="handSelect(2, 'c110301')"
                        class="orange tableTd top"
                        >{{ item.c110301 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 3 }"
                        @click="handSelect(3, 'c110401')"
                        class="orange tableTd top high"
                        >{{ item.c110401 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 4 }"
                        @click="handSelect(4, 'c110000')"
                        class="orange tableTd top"
                        >{{ item.c110000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 5 }"
                        @click="handSelect(5, 'c120101')"
                        class="orange tableTd top high"
                        >{{ item.c120101 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 6 }"
                        @click="handSelect(6, 'c120301')"
                        class="orange tableTd top high"
                        >{{ item.c120301 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 7 }"
                        @click="handSelect(7, 'c120401')"
                        class="orange tableTd top"
                        >{{ item.c120401 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 8 }"
                        @click="handSelect(8, 'c120501')"
                        class="orange tableTd top high"
                        >{{ item.c120501 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 9 }"
                        @click="handSelect(9, 'c120000')"
                        class="orange tableTd top"
                        >{{ item.c120000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 10 }"
                        @click="handSelect(10, 'c100000')"
                        class="orange tableTd top high"
                        >{{ item.c100000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 11 }"
                        @click="handSelect(11, 'c210201')"
                        class="orange tableTd top"
                        >{{ item.c210201 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 12 }"
                        @click="handSelect(12, 'c210301')"
                        class="orange tableTd top high"
                        >{{ item.c210301 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 13 }"
                        @click="handSelect(13, 'c210000')"
                        class="orange tableTd top"
                        >{{ item.c210000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 14 }"
                        @click="handSelect(14, 'c220101')"
                        class="orange tableTd top high"
                        >{{ item.c220101 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 15 }"
                        @click="handSelect(15, 'c220201')"
                        class="orange tableTd top"
                        >{{ item.c220201 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 16 }"
                        @click="handSelect(16, 'c220000')"
                        class="orange tableTd top"
                        >{{ item.c220000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 17 }"
                        @click="handSelect(17, 'c200000')"
                        class="orange tableTd top"
                        >{{ item.c200000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 18 }"
                        @click="handSelect(18, 'c310301')"
                        class="orange tableTd top"
                        >{{ item.c310301 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 19 }"
                        @click="handSelect(19, 'c310401')"
                        class="orange tableTd top"
                        >{{ item.c310401 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 20 }"
                        @click="handSelect(20, 'c310000')"
                        class="orange tableTd top"
                        >{{ item.c310000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 21 }"
                        @click="handSelect(21, 'c320101')"
                        class="orange tableTd top"
                        >{{ item.c320101 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 22 }"
                        @click="handSelect(22, 'c320301')"
                        class="orange tableTd top high"
                        >{{ item.c320301 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 23 }"
                        @click="handSelect(23, 'c320000')"
                        class="orange tableTd top"
                        >{{ item.c320000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 24 }"
                        @click="handSelect(24, 'c300000')"
                        class="orange tableTd top"
                        >{{ item.c300000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 25 }"
                        @click="handSelect(25, 'c410201')"
                        class="orange tableTd top"
                        >{{ item.c410201 | filterVal("number") }}</span
                    >
                </div>
            </div>
        </div>
        <!-- 现金流量表  非金融 -->

        <!-- 现金流量表  银行 -->
        <div class="table w1021 flex" v-if="isBank == 'bank'">
            <div class="tableTh tableTr flex wrap w220 right">
                <span class="tableTd">现金流量表(百万元)</span>
                <span
                    :class="{
                        active_Row: activeRow == key,
                        high: item.high,
                    }"
                    @click="handSelect(key, item.itemInfo)"
                    v-for="(item, key, index) in bankData"
                    class="tableTd top left_tableTd"
                >
                    {{ item.title }}
                </span>
            </div>
            <div class="tableTr tableBody flex">
                <div
                    class="flex wrap w130"
                    v-for="(item, index) in datalist"
                    :key="index"
                >
                    <span class="tableTd">{{ item.enddate | dateFrom }}</span>
                    <span
                        :class="{ active_Row: activeRow == 1 }"
                        @click="handSelect(1, 'bc110001')"
                        class="orange tableTd top high"
                        >{{ item.bc110001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 2 }"
                        @click="handSelect(2, 'bc110007')"
                        class="orange tableTd top"
                        >{{ item.bc110007 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 3 }"
                        @click="handSelect(3, 'bc110008')"
                        class="orange tableTd top high"
                        >{{ item.bc110008 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 4 }"
                        @click="handSelect(4, 'bc110050')"
                        class="orange tableTd top high"
                        >{{ item.bc110050 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 5 }"
                        @click="handSelect(5, 'bc210000')"
                        class="orange tableTd top"
                        >{{ item.bc210000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 6 }"
                        @click="handSelect(6, 'bc120001')"
                        class="orange tableTd top"
                        >{{ item.bc120001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 7 }"
                        @click="handSelect(7, 'bc120045')"
                        class="orange tableTd top high"
                        >{{ item.bc120045 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 8 }"
                        @click="handSelect(8, 'bc120061')"
                        class="orange tableTd top high"
                        >{{ item.bc120061 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 9 }"
                        @click="handSelect(9, 'bc120004')"
                        class="orange tableTd top"
                        >{{ item.bc120004 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 10 }"
                        @click="handSelect(10, 'bc120063')"
                        class="orange tableTd top high"
                        >{{ item.bc120063 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 11 }"
                        @click="handSelect(11, 'bc120000')"
                        class="orange tableTd top"
                        >{{ item.bc120000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 12 }"
                        @click="handSelect(12, 'bc100000')"
                        class="orange tableTd top high"
                        >{{ item.bc100000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 13 }"
                        @click="handSelect(13, 'bc210001')"
                        class="orange tableTd top"
                        >{{ item.bc210001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 14 }"
                        @click="handSelect(14, 'bc210002')"
                        class="orange tableTd top"
                        >{{ item.bc210002 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 15 }"
                        @click="handSelect(15, 'bc210005')"
                        class="orange tableTd top high"
                        >{{ item.bc210005 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 16 }"
                        @click="handSelect(16, 'bc210006')"
                        class="orange tableTd top high"
                        >{{ item.bc210006 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 17 }"
                        @click="handSelect(17, 'bc210007')"
                        class="orange tableTd top high"
                        >{{ item.bc210007 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 18 }"
                        @click="handSelect(18, 'bc210000')"
                        class="orange tableTd top"
                        >{{ item.bc210000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 19 }"
                        @click="handSelect(19, 'bc220001')"
                        class="orange tableTd top"
                        >{{ item.bc220001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 20 }"
                        @click="handSelect(20, 'bc220002')"
                        class="orange tableTd top high"
                        >{{ item.bc220002 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 21 }"
                        @click="handSelect(21, 'bc220000')"
                        class="orange tableTd top high"
                        >{{ item.bc220000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 22 }"
                        @click="handSelect(22, 'bc200000')"
                        class="orange tableTd top high"
                        >{{ item.bc200000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 23 }"
                        @click="handSelect(23, 'bc310003')"
                        class="orange tableTd top"
                        >{{ item.bc310003 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 24 }"
                        @click="handSelect(24, 'bc310005')"
                        class="orange tableTd top"
                        >{{ item.bc310005 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 25 }"
                        @click="handSelect(25, 'bc310007')"
                        class="orange tableTd top high"
                        >{{ item.bc310007 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 26 }"
                        @click="handSelect(26, 'bc310000')"
                        class="orange tableTd top high"
                        >{{ item.bc310000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 27 }"
                        @click="handSelect(27, 'bc320001')"
                        class="orange tableTd top"
                        >{{ item.bc320001 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 28 }"
                        @click="handSelect(28, 'bc320005')"
                        class="orange tableTd top high"
                        >{{ item.bc320005 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 29 }"
                        @click="handSelect(29, 'bc320010')"
                        class="orange tableTd top high"
                        >{{ item.bc320010 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 30 }"
                        @click="handSelect(30, 'bc320000')"
                        class="orange tableTd top high"
                        >{{ item.bc320000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 31 }"
                        @click="handSelect(31, 'bc300000')"
                        class="orange tableTd top high"
                        >{{ item.bc300000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 32 }"
                        @click="handSelect(32, 'bc000004')"
                        class="orange tableTd top"
                        >{{ item.bc000004 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 33 }"
                        @click="handSelect(33, 'bc110009')"
                        class="orange tableTd top"
                        >{{ item.bc110009 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 34 }"
                        @click="handSelect(34, 'bc110000')"
                        class="orange tableTd top"
                        >{{ item.bc110000 | filterVal("number") }}</span
                    >
                    <span
                        :class="{ active_Row: activeRow == 35 }"
                        @click="handSelect(35, 'bc220007')"
                        class="orange tableTd top high"
                        >{{ item.bc220007 | filterVal("number") }}</span
                    >
                </div>
            </div>
        </div>
        <!-- 现金流量表  银行 -->
    </div>
</template>

<script>
import { mapState } from "vuex";
const href = window.location.href;
const stock = href.match(/stock=(\w+)/);
import echartsList from "./echartsList";
import { numberNo, number, finList,changeNumber } from "../../script/api";
import { bankData, genData, nonbankData } from "./data_tab_10";
export default {
    components: {
        echartsList,
    },
    data() {
        return {
            name: "",
            activeRow: 1,
            x_data: [],
            seriesList: [],
            datalist: [],
            isBank: "",
            timeIdx: 0, //时间区间 report-报告期，year-年报，quarter-季度
            timeType: {
                report: "按报告期",
                year: "按年度",
                quarter: "按单季度",
            },
            tabList: [
                {
                    finished: false,
                    list: [],
                },
                {
                    finished: false,
                    list: [],
                },
                {
                    finished: false,
                    list: [],
                },
            ],
            genData: genData,
            nonbankData: nonbankData,
            bankData: bankData,
        };
    },
    filters: {
        dateFrom(val) {
            return val.substring(0, 10);
        },
        filterVal(ops, num) {
            if (num == "numberNo") {
                return numberNo(ops, num);
            }
            if (num == "number") {
                return number(ops, num, 1000000);
            }
            if (num == "num") {
                return number(ops, num, 10000);
            }
            if (num == "numb") {
                return number(ops, num, 100);
            }
            if (num == "yiyuan") {
                return number(ops, num, 100000000);
            }
            return ops ? ops : "0.00";
        },
    },
    computed: {
        ...mapState(["isQuarter"]),
    },
    mounted() {
        this.init();
    },
    methods: {
        async init() {
            let stockCode = stock[1] || "";
            let timeInx = this.timeIdx || 0;
            let interval = Object.keys(this.timeType)[timeInx];

            if (this.tabList[timeInx].finished == true) return;

            if (stockCode.length > 6) {
                stockCode = stockCode.substring(2);
            } else {
                stockCode = stockCode;
            }

            await finList({ stockCode, type: "cash", interval }).then((res) => {
                this.tabList[timeInx].list = res.data;
                this.datalist = [...this.tabList[this.timeIdx].list];
                this.isBank = res.stockType;
                this.namechange();
                this.handleXData();
            });
        },

        namechange() {
            if (this.isBank == "gen") {
                this.name = this.genData[this.activeRow]["title"]+"（百万元）";
            }
            if (this.isBank == "nonbank") {
                this.name = this.nonbankData[this.activeRow]["title"]+"（百万元）";
            }
            if (this.isBank == "bank") {
                this.name = this.bankData[this.activeRow]["title"]+"（百万元）";
            }
        },

        handleXData() {
            this.x_data = [];
            this.seriesList = [];
            this.datalist.map((item) => {
                if (this.isBank == "nonbank") {
                    this.x_data.push(item.rptDate.substring(0, 10));
                } else {
                    this.x_data.push(item.enddate.substring(0, 10));
                }
                let y_data = 0;
                let key = null;
                if (this.isBank == "gen") {
                    //第一行数据
                    key = this.genData[this.activeRow].itemInfo;
                } else if (this.isBank == "nonbank") {
                    key = this.nonbankData[this.activeRow].itemInfo;
                } else if (this.isBank == "bank") {
                    key = this.bankData[this.activeRow].itemInfo;
                }
                y_data = changeNumber(item[key], 1000000);
                this.seriesList.push(y_data);
            });
            console.log("x_data", this.x_data);
            console.log("seriesList", this.seriesList);
        },

        handSelect(selectRow, key) {
            this.seriesList = [];
            this.activeRow = selectRow;
            this.namechange();
            this.datalist.map((item) => {
                let y_data = 0;
                if (item[key]) {
                    y_data = changeNumber(item[key], 1000000);
                }
                this.seriesList.push(y_data);
            });
            console.log("this.seriesList", this.seriesList);
        },
        onTime(item, key, index) {
            this.timeIdx = index;
            this.init();
            this.activeRow = 1;
        },
    },
};
</script>

<style lang="scss" scoped>
.nonbank_w220 {
    width: 300px !important;
}
.gen_w220 {
    width: 280px !important;
}
</style>